@ECHO off
REM
REM This batch file is a lazy man install for the Fusion Registry on Windows.
REM Configure the source_dir and dest_dir below. Also if you aren't using the
REM default style_images "1" directory change that value as well.
REM
REM $Id: deploy_registry.bat 23 2008-08-17 19:06:00Z registry.fusion $
REM

set source_dir=C:\svn\fusionregistry\upload
set dest_dir=C:\www\forum
set images_dir=1

ECHO.
ECHO Checking for directories and creating if they don't exist...
ECHO.
IF NOT EXIST %dest_dir%\style_images\%images_dir%\registry_images\nul (mkdir %dest_dir%\style_images\%images_dir%\registry_images)
IF NOT EXIST %dest_dir%\sources\components_acp\fusionscripts\nul (mkdir %dest_dir%\sources\components_acp\fusionscripts)
IF NOT EXIST %dest_dir%\sources\components_acp\fusionscripts\fusionregistry\nul (mkdir %dest_dir%\sources\components_acp\fusionscripts\fusionregistry)
IF NOT EXIST %dest_dir%\sources\components_public\fusionscripts\nul (mkdir %dest_dir%\sources\components_public\fusionscripts)
IF NOT EXIST %dest_dir%\sources\components_public\fusionscripts\fusionregistry\nul (mkdir %dest_dir%\sources\components_public\fusionscripts\fusionregistry)
IF NOT EXIST %dest_dir%\sources\components_public\fusionscripts\fusionregistry\lib\nul (mkdir %dest_dir%\sources\components_public\fusionscripts\fusionregistry\lib)

REM Save our wrists from some typing
set install_dir=%dest_dir%\sources\components_public\fusionscripts\fusionregistry\install
set upgrade_dir=%dest_dir%\sources\components_public\fusionscripts\fusionregistry\upgrade

IF NOT EXIST %install_dir%\nul (mkdir %install_dir%)
IF NOT EXIST %install_dir%\img\nul (mkdir %install_dir%\img)
IF NOT EXIST %install_dir%\sql\nul (mkdir %install_dir%\sql)
IF NOT EXIST %upgrade_dir%\img\nul (mkdir %upgrade_dir%\img)
IF NOT EXIST %upgrade_dir%\instagrade\nul (mkdir %upgrade_dir%\instagrade)
IF NOT EXIST %upgrade_dir%\upgrade_20007\nul (mkdir %upgrade_dir%\upgrade_20007)
IF NOT EXIST %upgrade_dir%\upgrade_30000\nul (mkdir %upgrade_dir%\upgrade_30000)
IF NOT EXIST %upgrade_dir%\upgrade_30001\nul (mkdir %upgrade_dir%\upgrade_30001)
IF NOT EXIST %upgrade_dir%\upgrade_30002\nul (mkdir %upgrade_dir%\upgrade_30002)
IF NOT EXIST %upgrade_dir%\upgrade_30003\nul (mkdir %upgrade_dir%\upgrade_30003)
IF NOT EXIST %upgrade_dir%\upgrade_30004\nul (mkdir %upgrade_dir%\upgrade_30004)
IF NOT EXIST %upgrade_dir%\upgrade_30005\nul (mkdir %upgrade_dir%\upgrade_30005)

ECHO.
ECHO Copying all files to destination...
ECHO.
copy %source_dir%\cache\lang_cache\en\*.* %dest_dir%\cache\lang_cache\en\
copy %source_dir%\sources\components_acp\*.* %dest_dir%\sources\components_acp\
copy %source_dir%\sources\components_acp\fusionscripts\fusionregistry\*.* %dest_dir%\sources\components_acp\fusionscripts\fusionregistry\
copy %source_dir%\sources\components_public\*.* %dest_dir%\sources\components_public\
copy %source_dir%\sources\components_public\fusionscripts\fusionregistry\*.* %dest_dir%\sources\components_public\fusionscripts\fusionregistry\
copy %source_dir%\sources\components_public\fusionscripts\fusionregistry\lib\*.* %dest_dir%\sources\components_public\fusionscripts\fusionregistry\lib\
copy %source_dir%\sources\portal_plugins\*.* %dest_dir%\sources\portal_plugins\
copy %source_dir%\sources\tasks\*.* %dest_dir%\sources\tasks\
copy %source_dir%\style_images\%images_dir%\registry_images\*.* %dest_dir%\style_images\%images_dir%\registry_images\
copy %source_dir%\sources\components_public\fusionscripts\fusionregistry\install\*.* %install_dir%\
copy %source_dir%\sources\components_public\fusionscripts\fusionregistry\install\img\*.* %install_dir%\img\
copy %source_dir%\sources\components_public\fusionscripts\fusionregistry\install\sql\*.* %install_dir%\sql\
copy %source_dir%\sources\components_public\fusionscripts\fusionregistry\upgrade\*.* %upgrade_dir%\
copy %source_dir%\sources\components_public\fusionscripts\fusionregistry\upgrade\img\*.* %upgrade_dir%\img\
copy %source_dir%\sources\components_public\fusionscripts\fusionregistry\upgrade\instagrade\*.* %upgrade_dir%\instagrade\
copy %source_dir%\sources\components_public\fusionscripts\fusionregistry\upgrade\upgrade_20007\*.* %upgrade_dir%\upgrade_20007\
copy %source_dir%\sources\components_public\fusionscripts\fusionregistry\upgrade\upgrade_30000\*.* %upgrade_dir%\upgrade_30000\
copy %source_dir%\sources\components_public\fusionscripts\fusionregistry\upgrade\upgrade_30001\*.* %upgrade_dir%\upgrade_30001\
copy %source_dir%\sources\components_public\fusionscripts\fusionregistry\upgrade\upgrade_30002\*.* %upgrade_dir%\upgrade_30002\
copy %source_dir%\sources\components_public\fusionscripts\fusionregistry\upgrade\upgrade_30003\*.* %upgrade_dir%\upgrade_30003\
copy %source_dir%\sources\components_public\fusionscripts\fusionregistry\upgrade\upgrade_30004\*.* %upgrade_dir%\upgrade_30004\
copy %source_dir%\sources\components_public\fusionscripts\fusionregistry\upgrade\upgrade_30005\*.* %upgrade_dir%\upgrade_30005\

ECHO.
ECHO All done!
ECHO.